package cn.lishiyuan.jaria2.client.enums;

/**
 * aria2c exit status
 *
 * https://aria2.github.io/manual/en/html/aria2c.html#exit-status
 */
public enum ExitStatusEnum {
    OK(0),
    UNKNOWN_ERROR(1),
    TIMEOUT_ERROR(2),
    RESOURCE_NOT_FOUND_ERROR(3),
    MAX_FILE_NOT_FOUND_ERROR(4),
    LOWEST_SPEED_LIMIT_ERROR(5),
    NETWORK_ERROR(6),
    UNFINISHED_DOWNLOADS_ERROR(7),
    RESUME_ERROR(8),
    NOT_ENOUGH_DISK_SPACE_ERROR(9),
    ALLOW_PIECE_LENGTH_CHANGE_ERROR(10),
    DOWNLOADING_SAME_FILE_ERROR(11),
    DOWNLOADING_SAME_TORRENT_ERROR(12),
    FILE_ALREADY_EXISTS_ERROR(13),
    RENAMING_FILE_FAILED_ERROR(14),
    EXISTING_FILE_CANNOT_BE_OPENED_ERROR(15),
    CREATING_NEW_FILE_FAILED_ERROR(16),
    FILE_IO_ERROR(17),
    CREATING_DIRECTORY_FAILED_ERROR(18),
    NAME_RESOLUTION_FAILED_ERROR(19),
    METALINK_PARSING_FAILED_ERROR(20),
    FTP_COMMAND_FAILED_ERROR(21),
    HTTP_HEADER_ERROR(22),
    TOO_MANY_REDIRECTS_ERROR(23),
    HTTP_AUTHORIZATION_ERROR(24),
    TORRENT_PARSING_FAILED_ERROR(25),
    TORRENT_FILE_CORRUPTED_ERROR(26),
    MAGNET_URI_ERROR(27),
    BAD_OPTION_ERROR(28),
    TEMPORARY_OVERLOAD_ERROR(29),
    JSON_RPC_PARSING_FAILED_ERROR(30),
    CHECKSUM_VALIDATION_FAILED_ERROR(32);

    private final int code;

    ExitStatusEnum(int code) {
        this.code = code;
    }

    public int getCode() {
        return code;
    }
}
